package com.gitee.dupe.dict.service;

import com.gitee.dolt.boot.service.SuperCacheService;
import com.gitee.dolt.boot.service.SuperService;
import com.gitee.dupe.dict.dto.DictionarySaveDTO;
import com.gitee.dupe.dict.dto.DictionaryTypeSaveDTO;
import com.gitee.dupe.dict.entity.Dictionary;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Set;


/**
 * <p>
 * 服务类
 * </p>
 *
 * @author LYH
 * @since 2020-10-11
 */
public interface IDictionaryService extends SuperCacheService<Dictionary> {

    /**
     * 自定义保存
     *
     * @param dictionary
     * @return
     */
    Dictionary handlerSave(DictionarySaveDTO dictionary);

    /**
     * 自定义编辑
     *
     * @param dictionary
     * @return
     */
    Dictionary handlerUpdate(DictionarySaveDTO dictionary);

    /**
     * 保存类型
     *
     * @param dictType
     * @return
     */
    Dictionary saveType(DictionaryTypeSaveDTO dictType);

    Dictionary updateType(DictionaryTypeSaveDTO dictType);

    boolean deleteType(List<Long> ids);

    /**
     * 查找字典
     *
     * @param types 类型
     * @return
     */
    Map<String, List<Dictionary>> listByTypes(List<String> types);

    /**
     * 查找字典
     *
     * @param typeKeys 类型+键
     * @return
     */
    Map<Serializable, Object> findDictionaryItem(Set<Serializable> typeKeys);
}
